import { createRouter, createWebHashHistory } from 'vue-router'
import NursingHome from '@/views/NursingHome.vue'
import Login from '@/views/Login.vue'
import Register from '@/views/Register.vue'
import AdministerHome from '@/views/AdministerHome.vue'
import UserHome from '@/views/UserHome.vue'
import NursingManagement from '@/components/administer/NursingManagement.vue'
import NormalManagement from '@/components/administer/NormalManagement.vue'
import Notice from '@/components/administer/Notice.vue'
import BedManagement from '@/components/administer/BedManagement.vue'
import NursingRelationshipManagement from '@/components/administer/NursingRelationshipManagement.vue'
import CheckInActivity from '@/components/administer/CheckInActivity.vue'
import MoveOutActivity from '@/components/administer/MoveOutActivity.vue'
import SystemHomepage from '@/components/administer/SystemHomepage.vue'
import AdminPersonalCenter from '@/components/administer/AdminPersonalCenter.vue'
import UserMain from '@/components/user/UserMain.vue'
import UserCheckin from '@/components/user/UserCheckin.vue'
import UserCheckout from '@/components/user/UserCheckout.vue'
import UserGoingout from '@/components/user/UserGoingout.vue'
import UserVisit from '@/components/user/UserVisit.vue'
import UserHealth from '@/components/user/UserHealth.vue'
import UserNursing from '@/components/user/UserNursing.vue'
import UserPersonCenter from '@/components/user/UserPersonCenter.vue'
import NurseMain from '@/components/nurse/NurseMain.vue'
import NursePersonalCenter from '@/components/nurse/NursePersonalCenter.vue'
import ElderInfoManagement from '@/components/nurse/ElderInfoManagement.vue'
import GoOutRegistrationManagement from '@/components/nurse/GoOutRegistrationManagement.vue'
import HealthInfoManagement from '@/components/nurse/HealthInfoManagement.vue'
import NursingInfoManagement from '@/components/nurse/NursingInfoManagement.vue'
import VisitingRegistrationManagement from '@/components/nurse/VisitingRegistrationManagement.vue'

const router = createRouter({
    history: createWebHashHistory(import.meta.env.BASE_URL),
    routes: [
        {
            path: "/",
            redirect: "/login"
        },
        {
            path: "/login",
            name: "Login",
            component: Login,
        },
        // 不同的页面，对应不同的路由地址
        {
            path: "/nursinghome",
            name: "NursingHome",
            component: NursingHome,
            redirect: "/nursinghome/nursemain",
            children: [
                {
                    path: "/nursinghome/nursemain",
                    name: "NurseMain",
                    component: NurseMain
                },
                {
                    path: "/nursinghome/elderinfomanagement",
                    name: "ElderInfoManagement",
                    component: ElderInfoManagement
                },
                {
                    path: "/nursinghome/registration/gooutregistrationmanagement",
                    name: "GoOutRegistrationManagement",
                    component: GoOutRegistrationManagement
                },
                {
                    path: "/nursinghome/healthinfomanagement",
                    name: "HealthInfoManagement",
                    component: HealthInfoManagement
                },
                {
                    path: "/nursinghome/nursepersonalcenter",
                    name: "NursePersonalCenter",
                    component: NursePersonalCenter
                },
                {
                    path: "/nursinghome/nursinginfomanagement",
                    name: "NursingInfoManagement",
                    component: NursingInfoManagement
                },
                {
                    path: "/nursinghome/registration/visitingregistrationmanagement",
                    name: "VisitingRegistrationManagement",
                    component: VisitingRegistrationManagement
                },
            ]
        },
        {
            path: "/register",
            name: "Register",
            component: Register,
        },
        {
            path: "/administerhome",
            name: "AdministerHome",
            component: AdministerHome,
            redirect: "/administerhome/systemhomepage",
            children: [
                { path: "/administerhome/systemhomepage", name: "SystemHomepage", component: SystemHomepage },
                { path: "/administerhome/user/nursing", name: "NursingManagement", component: NursingManagement },
                { path: "/administerhome/user/normal", name: "NormalManagement", component: NormalManagement },
                { path: "/administerhome/notice", name: "Notice", component: Notice },
                { path: "/administerhome/bed", name: "BedManagement", component: BedManagement },
                {
                    path: "/administerhome/nursingrelationshipmanagement",
                    name: "NursingRelationshipManagement",
                    component: NursingRelationshipManagement
                },
                { path: "/administerhome/activity/checkinactivity", name: "CheckInActivity", component: CheckInActivity },
                { path: "/administerhome/activity/moveoutactivity", name: "MoveOutActivity", component: MoveOutActivity },
                {
                    path: "/administerhome/personalcenter",
                    name: "adminpersonalcenter",
                    component: AdminPersonalCenter
                }
            ]
        },
        {
            path: "/userhome",
            name: "Userhome",
            component: UserHome,
            redirect: "/userhome/usermain",
            children: [
                {
                    path: "/userhome/usermain",
                    name: 'UserMain',
                    component: UserMain,
                },
                {
                    path: "/userhome/usercheckin",
                    name: 'UserCheckin',
                    component: UserCheckin,
                },
                {
                    path: "/userhome/usercheckout",
                    name: 'UserCheckout',
                    component: UserCheckout,
                },
                {
                    path: "/userhome/goingout",
                    name: 'UserGoingout',
                    component: UserGoingout,
                },
                {
                    path: "/userhome/uservisit",
                    name: 'UserVisit',
                    component: UserVisit,
                },
                {
                    path: "/userhome/userhealth",
                    name: 'UserHealth',
                    component: UserHealth,
                },
                {
                    path: "/userhome/usernursing",
                    name: 'UserNursing',
                    component: UserNursing,
                },
                {
                    path: "/userhome/userpersoncenter",
                    name: 'UserPersonCenter',
                    component: UserPersonCenter,
                },
            ]
        },
    ],
});

export default router
